<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('修改福利缴纳变动')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
    <th:block th:include="include :: container-css"/>

</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m"  id="form-welfarechange-edit" th:object="${welfareChange}" AUTOCOMPLETE="OFF">
        <input id="id" name="id" type="hidden" th:field="*{id}" />
        <div class="col-md-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">工号：</label>
                <div class="col-sm-9">
                    <input type="text" name="badge" id="badge"  class="form-control"
                           th:field="*{badge}"   disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-9">
                    <input type="text" name="name" id="name" class="form-control"  placeholder="请输入文本"
                           th:field="*{name}"    disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">原缴纳状态：</label>
                <div class="col-sm-9">
                    <input type="text" name="benefitStatusName" id="benefitStatusName" class="form-control"  placeholder="请输入文本"
                           th:field="*{benefitStatusName}"    disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">新缴纳状态：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="newBenefitStatus" id="newBenefitStatus"
                            th:with="type=${@dict.getType('CCD_BENEFITSTATUS')}">
                        <option value="0"></option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{newBenefitStatus}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">原社保缴纳地区：</label>
                <div class="col-sm-9">
                    <input type="text" name="benefitCityName" id="benefitCityName" class="form-control"  placeholder="请输入文本"
                           th:field="*{benefitCityName}"    disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">新社保缴纳地区：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="newBenefitCity" id="newBenefitCity">
                        <option value="0"></option>
                        <option th:each="welfareRegionConfigs:${welfareRegionConfigs}"
                                th:value="${welfareRegionConfigs.id }"
                                th:field="*{newBenefitCity}" th:text="${welfareRegionConfigs.title }"></option>


                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">原公积金缴纳地区：</label>
                <div class="col-sm-9">
                    <input type="text" name="accuCityName" id="accuCityName" class="form-control"  placeholder="请输入文本"
                           th:field="*{accuCityName}"    disabled="disabled">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">新公积金缴纳地区：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="newAccuCity"  id="newAccuCity">
                        <option value="0"></option>
                        <option th:each="welfareRegionConfigs:${welfareRegionConfigs}"
                                th:value="${welfareRegionConfigs.id }"
                                th:field="*{newAccuCity}" th:text="${welfareRegionConfigs.title }"></option>


                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">生效日期：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control laydate-demo-2" th:field="*{effectdate}" name="effectdate" id="effectdate"  placeholder="yyyy-MM-dd">
                </div>
            </div>



        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: hr-help-js"/>

<script th:inline="javascript">
    var prefix = ctx + "welfare/welfareChange";
$(function () {
    $(".datetimepicker-demo-2").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '.laydate-demo-2',
            type: 'date'
        });

    });


});
function submitHandler() {
    edit();
};
function edit() {
    if ($.validate.form()) {
        var data = $("#form-welfarechange-edit").serializeArray();


        var id = $("input[name='id']").val();
        var newBenefitStatusName = $("#newBenefitStatusName").val();
        var newBenefitCityName = $("#newBenefitCityName").val();
        var newAccuCityName = $("#newAccuCityName").val();
        var effectdate = $("input[name='effectdate']").val();
        data.push({"id": "id", "value": id});
        data.push({"id": "newBenefitStatusName", "value": newBenefitStatusName});
        data.push({"id": "newBenefitCityName", "value": newBenefitCityName});
        data.push({"id": "newAccuCityName", "value": newAccuCityName});
        data.push({"id": "effectdate", "value": effectdate});

        $.operate.save(prefix + "/edit", data);
    }
}
</script>
</body>
</html>